import org.apache.spark.{SparkConf, SparkContext}

import scala.util.Random

object SparkPi {
  def main(args: Array[String]): Unit = {
    val sparkConf = new SparkConf()
    sparkConf.setAppName("SparkPI")
    sparkConf.setMaster("local[4]")
    val sparkContext = new SparkContext(sparkConf)
    val num = 1000000
    val list = 0.to(num)
    val rdd = sparkContext.parallelize(list, 10)
    rdd.map(i => {
      val x = Random.nextFloat() * 2 - 1
    })
  }
}
